package com.weige.mybatisplus.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: wei
 * @date: 2022-11-09 9:22
 * @description: 用户实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
//  数据库名与实体类名不一致时使用
@TableName("tb_user")
public class User {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String name;
    @TableField(value = "pwd", select = false)
    private String password;
    private Integer age;
    private String tel;
    private Integer money;
    //  表示该字段不参与CRUD操作
    @TableField(exist = false)
    private Boolean online;
    //  逻辑删除字段
    @TableLogic(value = "0", delval = "1")
    private Integer deleted;
    //  乐观锁
    @Version
    private Integer version;
}
